<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>地图坐标概念</title>
    <style type="text/css">
        body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
    </style>
    <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=meWpk6T4jHKOLxgpj3gvbvj86yFEuXXg"></script>
</head>
<body>
<div id="allmap"></div>
<script>
    var map =new BMap.Map("allmap");
    map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);

    var TILE_SIZE =256;

    var tileLayer = new BMap.TileLayer();

    tileLayer.getTilesUrl = function (tileCoord, zoom) {


        if (zoom >= 8) {
            var x = tileCoord.x;
            var y = tileCoord.y;

            if (x < 0) {
                x = 'M' + (-x);
            }
            if (y < 0) {
                y = 'M' + (-y);
            }


          //  http://online1.map.bdimg.com/onlinelabel/?qt=tile&x=49310&y=10242&z=18
            //根据瓦片的文件路径拼接URL
            //var url = '/images/9.jpg';

         //   var url= "http://online1.map.bdimg.com/onlinelabel/?qt=tile&x=" + x + "&y=" + "&z="+zoom;
           var url ="http://mt2.google.cn/vt/lyrs=m@167000000&hl=zh-CN&gl=cn&x="+x +"&y="+y+"&z="+zoom +"&s=Galil";
            return url;

        }

    }

    map.addTileLayer(tileLayer);


</script>
</body>
</html>